#include <stdint.h>
#include "gd32f30x.h"
#include "bsp_dwt.h"
#include "bsp_key_state.h"
#include "bsp_systick.h"

void systick_config(void)
{
    /* setup systick timer for 1000Hz interrupts */
    if (SysTick_Config(SystemCoreClock / 1000U))
    {
        /* capture error */
        while (1)
        {
        }
    }

    /* configure the systick handler priority */
    NVIC_SetPriority(SysTick_IRQn, 0x00U);
}

int main(void)
{
	uint8_t keyVal;
	
	SystickInit();
	KeyStateInit();
	
	while(1)
	{
		keyVal = GetKeyVal();
		switch(keyVal)
		{
			case KEY1_SHORT_PRESS:
				break;
			case KEY2_LONG_PRESS:
				break;
		}
	}
}
